package woaini.fenger.core.bot.manager.key;

import java.io.Serializable;
import java.util.Objects;

import lombok.Data;
import woaini.fenger.core.bot.enums.PLatFormEnum;
import woaini.fenger.core.bot.id.ID;

/**
 * bot键
 * @see  woaini.fenger.core.bot.manager.key.BotKey
 * @author yefeng
 * {@code @Date} 2023-05-16 16:50:39
 */
@Data
public class BotKey implements Serializable {

    ID id;

    PLatFormEnum pLatFormEnum;

    public BotKey(ID id, PLatFormEnum pLatFormEnum) {
        this.id = id;
        this.pLatFormEnum = pLatFormEnum;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null || getClass() != object.getClass()) {
            return false;
        }
        BotKey botKey = (BotKey) object;
        return id.equals(botKey.id) && pLatFormEnum.equals(botKey.pLatFormEnum);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, pLatFormEnum);
    }
}
